#!/usr/bin/env python3

"""
telegram-bot-shadowrun
desc: A telegram bot for shadowrun. Provides inline, /r, /roll.
      This file is the CLI wrapper.
license: AGPL-3.0-only, see COPYING
"""

import argparse
import unittest
import src.shadowrun_bot as bot

def main():
    """CLI for the bot. Implements two features:
    run: runs the bot
    test: launches tests against the current config"""
    parser = argparse.ArgumentParser(description="A shadowrun bot for telegram")
    parser.add_argument('mode', nargs="?", help="run or test")
    parsed = parser.parse_args()
    if parsed.mode == "run":
        bot.main()
    elif parsed.mode == "test":
        loader = unittest.TestLoader()
        suite = loader.discover("tests")
        runner = unittest.TextTestRunner()
        runner.run(suite)
    else:
        parser.print_help()

if __name__ == "__main__":
    main()
